﻿<!--#include file="const.asp"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>

<%
if sid="Null" then
	Response.Redirect "login.asp"
	Response.end
end if
IF  Request.QueryString("Action")="login" Then
	call login
elseif Request.QueryString("Action")="index" then
	call index
else
	call qinten
end if
end Function

Function qinten
%>
<card title="添加商品"><p align="left">
==添加商品==<br/>
-------------<br/>
<a href='addshangpin.asp?Action=index&amp;act=1&amp;sid=<%=sid%>'>添加头像</a><br/>
<a href='addshangpin.asp?Action=index&amp;act=2&amp;sid=<%=sid%>'>添加勋章</a><br/>
<a href='addshangpin.asp?Action=index&amp;act=3&amp;sid=<%=sid%>'>添加礼物</a><br/>
<a href='addshangpin.asp?Action=index&amp;act=4&amp;sid=<%=sid%>'>添加道具</a><br/>
-------------<br/>
<a href='shangpin.asp?sid=<%=sid%>'>返回商品管理</a><br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a>
<%
End Function
Function index
	dim act,Runtxt
	Runtxt=qingtian.RunStr
%>
	<card title="添加商品"><p align="left">
<%
act=Request.QueryString("act")
select case act
case "1"
%>
	==添加头像==<br/>
	添加头像图片：<a href='wenjian.asp?url=addshangpin.asp?Action=index@act=<%=Request.QueryString("act")%>&amp;sid=<%=sid%>'>上传头像</a><br/>
	<input emptyok="true"  name="touxian<%=Runtxt%>" value="<%=Request.QueryString("tp")%>" type="text"/><br/>
	名称：<br/>
	<input emptyok="true"  name="name<%=Runtxt%>" value="" type="text"/><br/>
	简介：<br/>
	<input emptyok="true"  name="ton<%=Runtxt%>" value="" type="text"/><br/>
	价格/<%=qingtian.bi%>：<br/>
	<input emptyok="true"  name="paym<%=Runtxt%>" value="0" type="text"/><br/>
	分类：<br/>
	<select name="bitt<%=Runtxt%>" value="">
    <option value="16">魅力头像/男</option>
    <option value="17">魅力头像/女</option>
	</select><br/>
    	<anchor>确定提交<go href="addshangpin.asp?Action=login&amp;act=<%=act%>&amp;sid=<%=sid%>" method='post'>
        <postfield name="name" value="$(name<%=Runtxt%>)"/>
        <postfield name="ton" value="$(ton<%=Runtxt%>)"/>
        <postfield name="paym" value="$(paym<%=Runtxt%>)"/>
        <postfield name="bitt" value="$(bitt<%=Runtxt%>)"/>
        <postfield name="touxian" value="$(touxian<%=Runtxt%>)"/>
    	</go>
	</anchor><br/>
<%
case "2"
%>
	==添加勋章==<br/>
	添加勋章图片：<a href='wenjian.asp?url=addshangpin.asp?Action=index@act=<%=Request.QueryString("act")%>&amp;sid=<%=sid%>'>上传勋章</a><br/>
	<input emptyok="true"  name="xunzan<%=Runtxt%>" value="<%=Request.QueryString("tp")%>" type="text"/><br/>
	名称：<br/>
	<input emptyok="true"  name="name<%=Runtxt%>" value="" type="text"/><br/>
	简介：<br/>
	<input emptyok="true"  name="ton<%=Runtxt%>" value="" type="text"/><br/>
	价格/<%=qingtian.bit%>：<br/>
	<input emptyok="true"  name="paym<%=Runtxt%>" value="0" type="text"/><br/>
    	<anchor>确定提交<go href="addshangpin.asp?Action=login&amp;act=<%=act%>&amp;sid=<%=sid%>" method='post'>
        <postfield name="name" value="$(name<%=Runtxt%>)"/>
        <postfield name="ton" value="$(ton<%=Runtxt%>)"/>
        <postfield name="paym" value="$(paym<%=Runtxt%>)"/>
        <postfield name="xunzan" value="$(xunzan<%=Runtxt%>)"/>
    	</go>
	</anchor><br/>
<%
case "3"
%>
	==添加礼物==<br/>
	图片：<a href='wenjian.asp?url=addshangpin.asp?Action=index@act=<%=Request.QueryString("act")%>&amp;sid=<%=sid%>'>上传图片</a><br/>
	<input emptyok="true"  name="tupic<%=Runtxt%>" value="<%=Request.QueryString("tp")%>" type="text"/><br/>
	名称：<br/>
	<input emptyok="true"  name="name<%=Runtxt%>" value="" type="text"/><br/>
	简介：<br/>
	<input emptyok="true"  name="ton<%=Runtxt%>" value="" type="text"/><br/>
	价格：<br/>
	<input emptyok="true"  name="paym<%=Runtxt%>" value="0" type="text"/><br/>
		商城类别：<br/>
	<select name="bip<%=Runtxt%>" value="">
	<option value="3"><%=qingtian.bi%>商城</option>
	<option value="4"><%=qingtian.bit%>商城</option>
	</select><br/>
	商品分类：<br/>
	<select name="bitt<%=Runtxt%>" value="">
    <option value="1">鲜花</option>
    <option value="2">爱情</option>
    <option value="3">食品</option>
    <option value="4">服饰</option>
    <option value="5">证件</option>
    <option value="6">魔法</option>
    <option value="7">节日</option>
    <option value="8">玩具</option>
	</select><br/>
	增加魅力：<br/>
	<input emptyok="true"  name="zmeili<%=Runtxt%>" value="0" type="text"/><br/>
    	<anchor>确定提交<go href="addshangpin.asp?Action=login&amp;act=<%=act%>&amp;sid=<%=sid%>" method='post'>
        <postfield name="tupic" value="$(tupic<%=Runtxt%>)"/>
        <postfield name="name" value="$(name<%=Runtxt%>)"/>
        <postfield name="ton" value="$(ton<%=Runtxt%>)"/>
        <postfield name="paym" value="$(paym<%=Runtxt%>)"/>
        <postfield name="bip" value="$(bip<%=Runtxt%>)"/>
        <postfield name="bitt" value="$(bitt<%=Runtxt%>)"/>
        <postfield name="zmeili" value="$(zmeili<%=Runtxt%>)"/>
    	</go>
	</anchor><br/>

<%
case "4"
%>
	==添加道具==<br/>
	图片：<a href='wenjian.asp?url=addshangpin.asp?Action=index@act=<%=Request.QueryString("act")%>&amp;sid=<%=sid%>'>上传图片</a><br/>
	<input emptyok="true"  name="tupic<%=Runtxt%>" value="<%=Request.QueryString("tp")%>" type="text"/><br/>
	名称：<br/>
	<input emptyok="true"  name="name<%=Runtxt%>" value="" type="text"/><br/>
	简介：<br/>
	<input emptyok="true"  name="ton<%=Runtxt%>" value="" type="text"/><br/>
	价格：<br/>
	<input emptyok="true"  name="paym<%=Runtxt%>" value="0" type="text"/><br/>
		商城类别：<br/>
	<select name="bip<%=Runtxt%>" value="">
	<option value="1"><%=qingtian.bi%>商城</option>
	<option value="2"><%=qingtian.bit%>商城</option>
	</select><br/>
	商品分类：<br/>
	<select name="bitt<%=Runtxt%>" value="">
    <option value="9">体力道具</option>
    <option value="10">魅力道具</option>
    <option value="11">趣味道具</option>
    <option value="12">积分道具</option>
    <option value="13">货币道具</option>
    <option value="14">VIP道具</option>
	</select><br/>
	增加<%=qingtian.bi%>(仅<%=qingtian.bit%>商城时有效)：<br/>
	<input emptyok="true"  name="zbit<%=Runtxt%>" value="0" type="text"/><br/>
	增加魅力：<br/>
	<input emptyok="true"  name="zmeili<%=Runtxt%>" value="0" type="text"/><br/>
	增加体力：<br/>
	<input emptyok="true"  name="ztili<%=Runtxt%>" value="0" type="text"/><br/>
	增加积分：<br/>
	<input emptyok="true"  name="zjifen<%=Runtxt%>" value="0" type="text"/><br/>
	增加VIP(如需增加一个月就填1)：<br/>
	<input emptyok="true"  name="zvip<%=Runtxt%>" value="0" type="text"/><br/>
    	<anchor>确定提交<go href="addshangpin.asp?Action=login&amp;act=<%=act%>&amp;sid=<%=sid%>" method='post'>
        <postfield name="tupic" value="$(tupic<%=Runtxt%>)"/>
        <postfield name="name" value="$(name<%=Runtxt%>)"/>
        <postfield name="ton" value="$(ton<%=Runtxt%>)"/>
        <postfield name="paym" value="$(paym<%=Runtxt%>)"/>
        <postfield name="bip" value="$(bip<%=Runtxt%>)"/>
        <postfield name="bitt" value="$(bitt<%=Runtxt%>)"/>
        <postfield name="zbit" value="$(zbit<%=Runtxt%>)"/>
        <postfield name="zmeili" value="$(zmeili<%=Runtxt%>)"/>
        <postfield name="ztili" value="$(ztili<%=Runtxt%>)"/>
        <postfield name="zjifen" value="$(zjifen<%=Runtxt%>)"/>
        <postfield name="zvip" value="$(zvip<%=Runtxt%>)"/>
    	</go>
	</anchor><br/>
<%
End Select
%>
-------------<br/>
<a href='shangpin.asp?sid=<%=sid%>'>返回商品管理</a><br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
End Function


Function login

		dim rs,sql,errs,tupic,name,ton,paym,bip,bitt,zbit,zmeili,ztili,zjifen,zvip,xunzan,touxian,act,nid
act=Request.QueryString("act")
select case act
case "1"

        tupic=Replace(Request.form("touxian"),"'","''")
        name=Replace(Request.form("name"),"'","''")
        ton=Replace(Request.form("ton"),"'","''")
        paym=Replace(Request.form("paym"),"'","''")
        bip=5
        bitt=Replace(Request.form("bitt"),"'","''")
        zbit=0
        zmeili=0
        ztili=0
        zjifen=0
        zvip=0
        touxian=Replace(Request.form("touxian"),"'","''")

case "2"

        tupic=Replace(Request.form("xunzan"),"'","''")
        name=Replace(Request.form("name"),"'","''")
        ton=Replace(Request.form("ton"),"'","''")
        paym=Replace(Request.form("paym"),"'","''")
        bip=6
        bitt=15
        zbit=0
        zmeili=0
        ztili=0
        zjifen=0
        zvip=0
        xunzan=Replace(Request.form("xunzan"),"'","''")

case "3"

        tupic=Replace(Request.form("tupic"),"'","''")
        name=Replace(Request.form("name"),"'","''")
        ton=Replace(Request.form("ton"),"'","''")
        paym=Replace(Request.form("paym"),"'","''")
        bip=Replace(Request.form("bip"),"'","''")
        bitt=Replace(Request.form("bitt"),"'","''")
        zbit=0
        zmeili=Replace(Request.form("zmeili"),"'","''")
        ztili=0
        zjifen=0
        zvip=0

case "4"
        tupic=Replace(Request.form("tupic"),"'","''")
        name=Replace(Request.form("name"),"'","''")
        ton=Replace(Request.form("ton"),"'","''")
        paym=Replace(Request.form("paym"),"'","''")
        bip=Replace(Request.form("bip"),"'","''")
        bitt=Replace(Request.form("bitt"),"'","''")
        zbit=Replace(Request.form("zbit"),"'","''")
        zmeili=Replace(Request.form("zmeili"),"'","''")
        ztili=Replace(Request.form("ztili"),"'","''")
        zjifen=Replace(Request.form("zjifen"),"'","''")
        zvip=Replace(Request.form("zvip"),"'","''")
End Select

		errs=""
		if tupic="" or name="" or ton="" or paym="" or bip="" or bitt="" or zbit="" or zmeili="" or ztili="" or zjifen="" or zvip="" then errs=errs & "关键名称不能为空<br/>"
	%>
	<card id="login" title="添加商品" ontimer="shangpin.asp?sid=<%=sid%>"><timer value="20"/>
		<p align="left">
	<%
	IF len(errs)=0 then
               	set rs=Server.CreateObject("ADODB.Recordset")
		Sql = "select  * FROM qingtian_shangpin"
		rs.open sql,conn,1,3
		rs.addnew
        rs("tupic")=tupic
        rs("name")=name
        rs("ton")=ton
        rs("paym")=paym
        rs("bip")=bip
        rs("bitt")=bitt
        rs("zbit")=zbit
        rs("zmeili")=zmeili
        rs("ztili")=ztili
        rs("zjifen")=zjifen
        rs("zvip")=zvip
        rs("xunzan")=xunzan
        rs("touxian")=touxian
		rs.update()
                nid=rs("id")
		rs.Close
		Set rs = Nothing
conn.execute("update qingtian_shangpin set [nid]="&nid&" where id="&nid&"")
		%>添加商品成功!<br/><%

	else%>
		<%=errs%>
		<a href="addshangpin.asp?act=<%=act%>&amp;sid=<%=sid%>">返回修改</a><br/>
<%	end if
%>
<a href='shangpin.asp?sid=<%=sid%>'>返回商品管理</a><br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
end Function 


%>
